package edu.cuit.avatar.demo;

import java.time.LocalDate;
import java.util.Calendar;
import java.util.GregorianCalendar;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/10 10:43
 */
public class CalendarTest {
    public static void main(String[] args) {
        Calendar calendar = new GregorianCalendar();
        //Calendar calendar = Calendar.getInstance();
        System.out.println(LocalDate.now());
        System.out.println("Year:" + calendar.get(Calendar.YEAR));
        System.out.println("Month:" + calendar.get(Calendar.MONTH));
        System.out.println("Date:" + calendar.get(Calendar.DATE));
        System.out.println("Hour:" + calendar.get(Calendar.HOUR));
        System.out.println("Minute:" + calendar.get(Calendar.MINUTE));
        System.out.println("Second:" + calendar.get(Calendar.SECOND));
        System.out.println("Day of week:" + calendar.get(Calendar.DAY_OF_WEEK));
        System.out.println("Day of month:" + calendar.get(Calendar.DAY_OF_MONTH));
        System.out.println("Day of year:" + calendar.get(Calendar.DAY_OF_YEAR));

        calendar.set(Calendar.MONTH, 5);

    }
}
